<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>crossdomainrpc.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">crossdomainrpc.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Cross domain RPC library using the <a
 href="http://go/xd2_design" target="_top">XD2 approach</a>.

 <h5>Protocol</h5>
 Client sends a request across domain via a form submission.  Server
 receives these parameters: "xdpe:request-id", "xdpe:dummy-uri" ("xdpe" for
 "cross domain parameter to echo back") and other user parameters prefixed
 with "xdp" (for "cross domain parameter").  Headers are passed as parameters
 prefixed with "xdh" (for "cross domain header").  Only strings are supported
 for parameters and headers.  A GET method is mapped to a form GET.  All
 other methods are mapped to a POST.  Server is expected to produce a
 HTML response such as the following:
 <pre class="lang-js prettyprint">
 &amp;lt;body&amp;gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;
 src=&amp;quot;path-to-crossdomainrpc.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
 var currentDirectory = location.href.substring(
 0, location.href.lastIndexOf(&amp;#39;/&amp;#39;)
 );

 // echo all parameters prefixed with &amp;quot;xdpe:&amp;quot;
 var echo = {};
 echo[goog.net.CrossDomainRpc.PARAM_ECHO_REQUEST_ID] =
 &amp;lt;value of parameter &amp;quot;xdpe:request-id&amp;quot;&amp;gt;;
 echo[goog.net.CrossDomainRpc.PARAM_ECHO_DUMMY_URI] =
 &amp;lt;value of parameter &amp;quot;xdpe:dummy-uri&amp;quot;&amp;gt;;

 goog.net.CrossDomainRpc.sendResponse(
 &amp;#39;({&amp;quot;result&amp;quot;:&amp;quot;&amp;lt;responseInJSON&amp;quot;})&amp;#39;,
 true,    // is JSON
 echo,    // parameters to echo back
 status,  // response status code
 headers  // response headers
 );
 &amp;lt;/script&amp;gt;
 &amp;lt;/body&amp;gt;
 </pre>

 <h5>Server Side</h5>
 For an example of the server side, refer to the following files:
 <ul>
 <li><a href="http://go/xdservletfilter.java">http://go/xdservletfilter.java</a></li>
 <li><a href="http://go/xdservletrequest.java">http://go/xdservletrequest.java</a></li>
 <li><a href="http://go/xdservletresponse.java">http://go/xdservletresponse.java</a></li>
 </ul>

 <h5>System Requirements</h5>
 Tested on IE6, IE7, Firefox 2.0 and Safari nightly r23841.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_net_crossdomainrpc.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/closure/goog/net/crossdomainrpc.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">net/crossdomainrpc.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_net_CrossDomainRpc.html">
          goog.net.CrossDomainRpc</a><br/>
        <div class="class-details">Creates a new instance of cross domain RPC</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.createInputHtml_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">createInputHtml_<span class="args">(<span class="arg">name</span>,&nbsp;<span class="arg">value</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Creates the HTML of an input element
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">name</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Name of input element.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">value</span>
        : <div class="fullType"><span class="type">*</span></div>
        <div class="entryOverview">Value of input element.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            HTML of input element with that name and value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line215">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.createResponseInfo_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">createResponseInfo_<span class="args">(<span class="arg">dummyUri</span>,&nbsp;<span class="arg">numChunks</span>,&nbsp;<span class="arg">isDataJson</span>,&nbsp;<span class="arg">status</span>,&nbsp;<span class="arg">headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Creates a response info iframe to indicate completion of sendResponse
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyUri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to a dummy resource.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">numChunks</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">Total number of chunks.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">isDataJson</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Whether response is a JSON string or just string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">status</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">HTTP response status code.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">headers</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response headers in JSON format.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line783">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.escapeAmpersand_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">escapeAmpersand_<span class="args">(<span class="arg">value</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">*</span></div>
      </div>


     <div class="entryOverview">
       Escapes ampersand so that XML/HTML entities are submitted as is because
browser unescapes them when they are put into a text area.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <div class="fullType"><span class="type">*</span></div>
        <div class="entryOverview">Value to escape.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">*</span></div>&nbsp;
            Value with ampersand escaped, if value is a string; otherwise the value itself is returned.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line229">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getDummyResourceUri_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getDummyResourceUri_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Finds a dummy resource that can be used by response to gain domain of
requester's page.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            URI of the resource to use.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line241">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getFramePayload_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getFramePayload_<span class="args">(<span class="arg">frame</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the payload of a frame (value after # or ? on the URL).  This value
is URL encoded except IE, where the value is not encoded to begin with.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">frame</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Frame.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Payload of that frame.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line579">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.getPayloadDelimiter_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">getPayloadDelimiter_<span class="args">(<span class="arg">dummyUri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns payload delimiter, either "#" when caller's page is not used as
the dummy resource or "?" when it is, in which case caching issues prevent
response frames to gain the caller's domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyUri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to resource being used as dummy resource.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Either "?" when caller's page is used as dummy resource or "#" if it is not.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line804">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.isInResponseIframe_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">isInResponseIframe_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type">*</span></div>
      </div>


     <div class="entryOverview">
       Checks to see if we are executing inside a response iframe.  This is the
case when this page is used as a dummy resource to gain caller's domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">*</span></div>&nbsp;
            True if we are executing inside a response iframe; false otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line116">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.isResponseInfoFrame_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">isResponseInfoFrame_<span class="args">(<span class="arg">frame</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Checks whether a frame is response info frame.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">frame</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Frame to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            True if frame is a response info frame; false otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line560">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.removeHash_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">removeHash_<span class="args">(<span class="arg">uri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Removes everything at and after hash from URI
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Uri to to remove hash.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Uri with its hash and all characters after removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line303">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.removeUriParams_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">removeUriParams_<span class="args">(<span class="arg">uri</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Removes all parameters (after ? or #) from URI.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to remove parameters from.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            URI with all parameters removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line815">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.send"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">send<span class="args">(<span class="arg">uri</span>,&nbsp;<span class="arg">opt_continuation</span>,&nbsp;<span class="arg">opt_method</span>,&nbsp;<span class="arg">opt_params</span>,&nbsp;<span class="arg">opt_headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sends a request across domain.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">uri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Uri to make request to.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_continuation</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Continuation function to be called when request is completed.  Takes one argument of an event object whose target has the following properties: "status" is the HTTP response status code, "responseText" is the response text, and "headers" is an object with all response headers.  The event target's getResponseJson() method returns a JavaScript object evaluated from the JSON response or undefined if response is not JSON.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_method</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Method of request. Default is POST.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_params</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Parameters. Each property is turned into a request parameter.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_headers</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Map of headers of the request.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line177">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.sendResponse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">sendResponse<span class="args">(<span class="arg">data</span>,&nbsp;<span class="arg">isDataJson</span>,&nbsp;<span class="arg">echo</span>,&nbsp;<span class="arg">status</span>,&nbsp;<span class="arg">headers</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Makes response available for grandparent (requester)'s receiveResponse
call to pick up by creating a series of iframes pointed to the dummy URI
with a payload (value after either ? or #) carrying a chunk of response
data and a response info iframe that tells the grandparent (requester) the
readiness of response.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">data</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response data (string or JSON string).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">isDataJson</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">true if data is a JSON string; false if just a string.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">echo</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
        <div class="entryOverview">Parameters to echo back "xdpe:request-id": Server that produces the response needs to copy it here to support multiple current XD requests on the same page. "xdpe:dummy-uri": URI to a dummy resource that response iframes point to to gain the domain of the client.  This can be an image (IE) or a CSS file (FF) found on the requester's page. Server should copy value from request parameter "xdpe:dummy-uri".</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">status</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">HTTP response status code.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">headers</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Response headers in JSON format.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line694">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setDebugMode"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setDebugMode<span class="args">(<span class="arg">flag</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets debug mode to true or false.  When debug mode is on, response iframes
are visible and left behind after their use is finished.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">flag</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Flag to indicate intention to turn debug model on (true) or off (false).</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line194">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setDummyResourceUri"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setDummyResourceUri<span class="args">(<span class="arg">dummyResourceUri</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the URI for a dummy resource on caller's domain.  This function is
used for specifying a particular resource to use rather than relying on
auto detection.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dummyResourceUri</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">URI to dummy resource on the same domain of caller's page.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line146">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.CrossDomainRpc.setUseFallBackDummyResource"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">setUseFallBackDummyResource<span class="args">(<span class="arg">useFallBack</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets whether a fallback dummy resource ("/robots.txt" on Firefox and Safari
and current page on IE) should be used when a suitable dummy resource is
not available.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">useFallBack</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Whether to use fallback or not.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line157">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.HEADER"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">HEADER</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Header prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line324">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.MAX_CHUNK_SIZE_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">MAX_CHUNK_SIZE_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Maximal chunk size.  IE can only handle 4095 bytes on its URL.
16MB has been tested on Firefox.  But 1MB is a practical size.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line653">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line331">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_CHUNK_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_CHUNK_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Query parameter 'chunk'.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line662">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo prefix.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line338">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO_DUMMY_URI"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO_DUMMY_URI</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo: dummy resource URI
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line353">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.PARAM_ECHO_REQUEST_ID"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">PARAM_ECHO_REQUEST_ID</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Parameter to echo: request id
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line345">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.REFERRER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">REFERRER_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Referrer of current document with all parameters after "?" and "#" stripped.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line848">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.REQUEST_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">REQUEST_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Cross-domain request marker.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line362">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_INFO_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_INFO_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Name of response info iframe.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line643">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_MARKER_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_MARKER_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Cross-domain response iframe marker.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line98">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.RESPONSE_POLLING_PERIOD_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">RESPONSE_POLLING_PERIOD_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       period of response polling (ms)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line445">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.SEND_RESPONSE_TIME_OUT_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">SEND_RESPONSE_TIME_OUT_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       timeout from response comes back to sendResponse is called (ms)
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line453">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.logger_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">logger_</span>
        : <div class="fullType">(<span class="type"><a href="class_goog_debug_Logger.html">goog.debug.Logger</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
     </div>


     <div class="entryOverview">
       Logger for goog.net.CrossDomainRpc
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line204">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.nextRequestId_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">nextRequestId_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       next request id used to support multiple XD requests at the same time
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line317">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.net.CrossDomainRpc.useFallBackDummyResource_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.CrossDomainRpc.</span><span class="entryName">useFallBackDummyResource_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
     </div>


     <div class="entryOverview">
       Use a fallback dummy resource if none specified or detected.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_net_crossdomainrpc.js.source.html#line106">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory net</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="net/crossdomainrpc.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
